using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Media.Media3D;
using System.Windows.Media;

namespace BulletDemo1
{
	public class MeshManager
	{
		public static void Append( MeshGeometry3D compositeMesh, MeshGeometry3D mesh, Matrix3D transform, Matrix textureTransform )
		{
			int baseIndex = compositeMesh.Positions.Count;

			foreach ( Point3D position in mesh.Positions ) compositeMesh.Positions.Add( transform.Transform( position ) );
			foreach ( Vector3D normal in mesh.Normals ) compositeMesh.Normals.Add( transform.Transform( normal ) );
			foreach ( int index in mesh.TriangleIndices ) compositeMesh.TriangleIndices.Add( baseIndex + index );

			foreach ( Point coord in mesh.TextureCoordinates ) compositeMesh.TextureCoordinates.Add( coord );

		}
	}
}
